﻿<?php include ("../connect.php"); ?>
<?php
	$ten_mt=$_POST['txtten_muc_tin'];
	$ms_loai_tin = $_POST['cbo_loai_tin'];
?>
<form name="frmTrolai" method="post" action="../index.php?noidung=tmt" >
<input type="hidden" name="txtten_muc_tin" value="<?php echo $ten_mt; ?>"/>
<input type="hidden" name="cbo_loai_tin" value="<?php echo $ms_loai_tin; ?>"/>
</form>
<?php
    $sql = "INSERT INTO muc_tin(MS_LOAI_TIN,TEN_MUC_TIN) 
	                    VALUES('$ms_loai_tin',N'$ten_mt')";
	$rs=mysql_query($sql);
    if($rs){
		echo "<script>
			alert('Thành công...');
		 	location.href='../index.php?noidung=tmt';
			</script>";
		exit;
	}else {
	echo "<script>
		alert('Chưa thêm được...');
		document.frmTrolai.submit();
		</script>";
	}
?>